{% extends 'cms/base.html' %}


{% block title %}
发布新闻
{% endblock title %}

{% block head %}
<script src="{% static 'js/news.min.js'%}"></script>
<script src="https://unpkg.com/qiniu-js@2.5.2/dist/qiniu.min.js"></script>
{% endblock head %}

{% block content-header %}
<h1>发布新闻</h1>
{% endblock content-header %}

{% block content %}
<div class="row">
  <!--  -->
  <div class="col-md-12">
    <div class="box box-primary">
      <form action="" class="form">
        <div class="box-body">
          <div class="form-group">
            <label for="title-form">标题</label>
            <input type="text" class="form-control" name="title" id="title-form">
          </div>
          <div class="form-group">
            <label for="category-form">分类</label>
            <select name="category" id="category-form" class="form-control">
              {% for category in categories %}
              <option value="{{category.id}}">{{category.name}}</option>
              {% endfor %}
            </select>
          </div>
          <div class="form-group">
            <label for="category-form">描述</label>
            <input type="text" class="form-control" id="desc-form" name="desc">
          </div>
          <div class="form-group">
            <label for="thumbnail-form">缩略图</label>
            <div class="input-group">
              <input type="text" class="form-control" name="thumbnail" id="thumbnail-form">
              <span class="input-group-btn">
                <label class="btn btn-default btn-file">
                  <input hidden type="file" class="btn btn-default" id="thumbnail-btn">
                  上传图片
                </label>
              </span>
            </div>
          </div>
          <div class="form-group">
            <label for="content-form">内容</label>
            <textarea class="form-control" name="content" id="content" rows="10" cols="30"></textarea>
          </div>
        </div>
        <div class="box-footer">
          <button class="btn btn-primary pull-right">发布新闻</button>
        </div>
      </form>
    </div>
  </div>
</div>
{% endblock %}